import { createHashHistory } from 'history'

let history = createHashHistory()

export const goto = (path, query) => {
	if (query) {
		history.push(path, { ...query })
	} else {
		history.push(path)
	}
}

export const replace = () => {
	if (query) {
		history.replace(path, { ...query })
	} else {
		history.replace(path)
	}
}

export const goBack = () => {
	history.goBack()
}
